<?php
/**
 * Registry pattern
 * @author Jakub Szajna <qba307@gmail.com>
 *
 */
class Reg {
    static private $reg = array();
    
    private function __construct() {}
    private function __clone() {}
    
    static function set( $key, &$value ) {
        self::$reg[ $key ] = $value;
    }
    
    static function delete( $key ) {
        unset( self::$reg[ $key ] );
    }
    
    static function &get( $key ) {
        $return = isset( self::$reg[ $key ] ) ? self::$reg[ $key ] : false;
        return $return;
    }
}